package acm.pta6;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class 加法器 {
    public static void main(String[] args) {
        Reader sc=new Reader();
        String radixs = sc.nextLine();
        BigInteger a = sc.nextBigInt();
        //        int a = sc.nextInt();
//        int b = sc.nextInt();
        BigInteger b = sc.nextBigInt();
        BigInteger zero = BigInteger.ZERO;
        BigInteger ten = BigInteger.TEN;
        StringBuilder sb=new StringBuilder();
        BigInteger advance=zero;
        BigInteger res=zero;
        int index=0;
        for (int i = radixs.length()-1; i >= 0; i--) {
            if (a.equals(zero)&&b.equals(zero)&&advance.equals(zero)){
                break;
            }

            BigInteger mod= ten.pow(index++);
            BigInteger[] add = add(a .mod(ten), b.mod(ten), advance, radixs.charAt(i) - '0');
            a=a.divide(ten);
            b=b.divide(ten);
            res=mod.multiply(add[1]).add(res);
            advance=add[0];
        }
        if (!advance.equals(zero)){
//            int mod= (int) Math.pow(10,index++);
            BigInteger mod= ten.pow(index++);
            res=advance.multiply(mod).add(res);
            //            res+=advance*mod;
        }
        System.out.println(res);
    }

    /**
     * @return :res[0]，进位，res[1],结果
     */
    public static BigInteger[] add(BigInteger a,BigInteger b,BigInteger advance,int radix){
        radix=radix==0?10:radix;
        BigInteger add=a.add(b).add(advance);
        BigInteger mod = BigInteger.valueOf(radix);
        return new BigInteger[]{add.divide(mod),add.mod(mod)};
    }
    static class Reader {
        private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer tokenizer = new StringTokenizer("");

        private String innerNextLine() {
            try {
                return reader.readLine();
            } catch (IOException ex) {
                return null;
            }
        }

        public boolean hasNext() {
            while (!tokenizer.hasMoreTokens()) {    //内存中没有
                String nextLine = innerNextLine();
                if (nextLine == null) {     //且没有下一行
                    return false;
                }
                tokenizer = new StringTokenizer(nextLine);  //读入一行
            }
            return true;
        }

        public String nextLine() {
            tokenizer = new StringTokenizer("");    //清空内存中的字符
            return innerNextLine();
        }

        public String next() {
            hasNext();
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble(){
            return Double.parseDouble(next());
        }
        public BigInteger nextBigInt() {
            return new BigInteger(next());
        }
    }
}
